import { axios } from '@/utils/request'
export function currentUserInfo () {
  return axios({
    url: '/user-service/user/info/current',
    method: 'get'
  })
}

export function loginApi (parameter) {
  return axios({
    url: '/user-service/user/auth/login',
    method: 'post',
    data: parameter
  })
}
export function getCodeKey () {
  return axios({
    url: '/user-service/user/auth/login/code',
    method: 'get'
  })
}
export function logoutApi (data) {
  return axios({
    url: '/user-service/user/auth/logout',
    method: 'post',
    data
  })
}
/**
 * 免密认证监控控制台
 * @returns {AxiosPromise}
 */
export function loginMonitorWithoutPwd () {
  return axios({
    url: '/user/login/monitor',
    method: 'post'
  })
}

/**
 * 验证SSO的token
 * @returns {AxiosPromise}
 */
export function getSSOToken (data) {
  return axios({
    url: '/user-service/user/auth/login/getToken/'+data,
    method: 'get'
  })
}